package com.wangshouyu.log.print;

import com.wangshouyu.log.enums.LogLevel;
import org.slf4j.Logger;

/**
 * @author 王守钰
 * @description slf4j日志打印
 * @date 2020/7/23 9:14
 */
public class Slf4jLogPrint {

    /**
     * 打印日志
     * @param log 日志打印器
     * @param logLevel 日志级别
     * @param param 参数
     * @param args 参数值
     */
    public static void printLog(Logger log, LogLevel logLevel, String param, Object... args) {
        switch (logLevel){
            case TRACE:
                log.trace(param, args);
                break;
            case DEBUG:
                log.debug(param, args);
                break;
            case INFO:
                log.info(param, args);
                break;
            case WARN:
                log.warn(param, args);
                break;
            case ERROR:
                log.error(param, args);
                break;
            default:
                break;
        }
    }
}
